import React from 'react'

import {WeaTools} from 'ecCom';
let Base64 = WeaTools.Base64;


export default class ContainerViewProxy extends React.Component{


    render(){
        const {ContainerView} = this.props
        const {data,tabId} = this.props.state
        const {items} = data

        //有more页面地址元素
        // let moreUrl = "/spa/document/static/index.html#/main/document/more?fromwhere=jsonFilter&outDoc=1&jsonstr="
        // let json = {"docCatalogIds":[],"orderby":[],"order":[]}
        // if(items.length > 0){
        //     json.docCatalogIds = items[tabId].setting.doc.split(',')
        // }
        // moreUrl += Base64.encode(more.toString())

        //没有more页面地址元素，需要在setting 中设配置项
        let moreUrl = ""
        if(items.length > 0 && items.find((element)=>(element.id == tabId))){
            moreUrl = items.find((element)=>(element.id == tabId)).setting.moreUrl
        }
        return (
            <ContainerView ecId={`${this && this.props && this.props.ecId || ''}_ContainerView@937wpb`} ref='ContainerView' {...this.props} moreUrl={moreUrl}></ContainerView>
        )
    }
}